<?php

namespace app\admin\controller;

use think\facade\Db;

class Server 
{
    public function insert($topic,$msg)
    {
        if($topic=='testtopic/mqtt')
            return;
        $time = time();
        $data = [
          'topic'=>$topic,
          'msg'=>$msg,
          'createtime'=>$time,
          'updatetime'=>$time
        ];
        Db::name('mqtt')->save($data);
    }
}